using UnityEngine;
using System.Collections;

public class enemyColliderController : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnCollisionEnter(Collision col) {
		float dmg;
		if (col.gameObject.tag == "Pprojectile") {
					Debug.Log("OMG");
			//gets the damage of the projectile
			dmg = col.gameObject.GetComponent<ammo>().getDamage();
			Debug.Log(dmg+" DAMAGE");
			transform.parent.GetComponent<enemy>().takeDamage(dmg);	
		}
	}
	
}
